'use strict';
var publicController = require('../../../Base/server/controllers/Public.server.controller');

module.exports = function (app) {
  // Root routing
  var core = require('../controllers/core.server.controller');

  // Define error pages
  app.route('/server-error').get(core.renderServerError);

  // Return a 404 for all undefined api, module or lib routes
  app.route('/:url(modules|lib)/*').get(core.renderNotFound);

  // Define application route
  app.route('/').get(core.renderIndex);
  app.route('/*').get(core.renderIndex);
  // app.route('/index/*').get(core.renderIndex);
  // app.route('/shared/*').get(core.renderIndex);
  
   app.route('/*').post(publicController.requestProxy);
};
